package com.iwuke.dance.wallet;

import android.view.View;
import android.widget.TextView;

import com.iwuke.dance.R;
import com.iwuke.dance.activity.BaseActivity;
import com.iwuke.dance.gadget_view.TitleBarView;
import com.iwuke.dance.util.Util;
import com.iwuke.dance.util.merchants_connect.NetworkEvent;

import de.greenrobot.event.Subscribe;
import de.greenrobot.event.ThreadMode;

/**
 * @author: 魏从响
 * @date: 2025/9/16
 * 密码成功
 */
public class PasswordSuccessfulActivity extends BaseActivity implements View.OnClickListener {

    private TitleBarView title_bar;
    private TextView button_return;
    private TextView tv_desc;
    private String type;

    /**
     * @description 网络实时监听
     */
    @Subscribe(threadMode = ThreadMode.MainThread)
    public void onEvent(NetworkEvent networkEvent){
        BaseActivity.setConnect(PasswordSuccessfulActivity.this,networkEvent,title_bar);

    }

    @Override
    protected int getView() {
        return R.layout.activity_password_success;
    }

    @Override
    protected void init(View mView) {

        title_bar = findViewById(R.id.title_bar);
        //描述
        tv_desc = findViewById(R.id.tv_desc);
        //返回
        button_return = findViewById(R.id.button_return);

        title_bar.setTitleText(null);
        title_bar.setLeftOnClick(this);
        button_return.setOnClickListener(this);

    }

    @Override
    protected void initData() {
        type = getIntent().getStringExtra("text");
        if (type ==null){
            tv_desc.setText("钱包开通成功");
        }else {
            tv_desc.setText("密码修改成功");
        }

    }

    @Override
    public void onClick(View v) {
        if (v.getId()==R.id.img_left){
            if (type ==null){//钱包开通成功
                Util.setIntent(this, WalletActivity.class);
            }else {//密码修改成功

            }
            finish();
        }else if (v.getId()==R.id.button_return){
            if (type ==null){//钱包开通成功
                Util.setIntent(this, WalletActivity.class);
            }else {//密码修改成功

            }
            finish();
        }
    }
}
